package com.itheima.bakery.demos.web.service;

import com.itheima.bakery.demos.web.model.CartItem;
import com.itheima.bakery.demos.web.model.Order;
import com.itheima.bakery.demos.web.model.OrderDetail;

import javax.servlet.http.HttpSession;
import java.util.List;
import java.util.Optional;

public interface OrderService {
    List<Order> findAllOrders();
    Optional<Order> findOrderById(Integer id);
    Order saveOrder(Order order);
    void deleteOrder(Integer id);
    void updateOrderTotal(Integer orderId);
    Integer createOrderAndDetails(Integer userId, List<CartItem> cartItems, HttpSession session);
    List<OrderDetail> findOrderDetailsByOrderId(Integer orderId);

}